from car import Car

class Battery:
    """一次模拟电动汽车电瓶的简单尝试"""

    def __init__(self, battery_size=50):
        """初始化电池属性"""
        self.battery_size = battery_size

    def describe_battery(self):
        """现实描述电池容量的信息"""
        print(f"本车电池容量 {self.battery_size} kWh")

    def get_range(self):
        """显示一条电池续航里程的信息"""
        if self.battery_size == 100:
            range = 1200
        elif self.battery_size == 50:
            range = 500

        print(f"本车续航里程 {range} kM")


class ElectricCar(Car):
    """模拟电动车的独特之处"""
    def __init__(self, make, model, year):
        """
        先初始化父类的属性，再初始化电动汽车特有的属性
        :param make: 制造商
        :param model: 品牌
        :param year: 年份
        """
        super().__init__(make,model,year)
        self.battery = Battery()